package com.mirce.controller;

import com.mirce.pojo.User;
import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@Controller
public class WebSocketController {


    @RequestMapping(value="/websocket/{name}")
    public String webSocket(@PathVariable String name, Model model) {
        try {

            model.addAttribute("username", name);
            return "websocket";
        } catch (Exception e) {

            return "error";
        }
    }


    @RequestMapping("/hh")
    public String index(){
        return "websocket.html";
    }

}